package org.jason.model.article.pojos;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 文章详情表
 * </p>
 *
 * @author jason
 * @since 2023-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ca_article")
@ApiModel(value="CaArticle对象", description="文章详情表")
public class CaArticle implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "文章标题")
    private String title;

    //文章简介
    @ApiModelProperty(value = "文章简介")
    private String description;

    @ApiModelProperty(value = "作者id")
    private Integer authorId;

    @ApiModelProperty(value = "作者昵称")
    private String authorNickname;

    @ApiModelProperty(value = "版块id")
    private Integer blockId;

    @ApiModelProperty(value = "版块名")
    private String blockName;

    @ApiModelProperty(value = "标签(标识文章话题)")
    private String tag;

    @ApiModelProperty(value = "封面url")
    private String coverUrl;

    @ApiModelProperty(value = "点赞数")
    private Integer likes;

    @ApiModelProperty(value = "收藏数")
    private Integer collection;

    @ApiModelProperty(value = "评论数")
    private Integer comment;

    @ApiModelProperty(value = "阅读量")
    private Integer views;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "发布时间/更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishedTime;

    @ApiModelProperty(value = "0正常1待审核2已锁定")
    private Integer status;

    @ApiModelProperty(value = "删除标记0正常1删除")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Integer deleteFlag;

    @ApiModelProperty(value = "乐观锁")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @Version
    private Integer version;
}
